3.228 \(\int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx\)

Optimal. Leaf size=104 \[ \frac {2 \sqrt {d} \sqrt {b c-a d} \tan ^{-1}\left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )}{c^2}+\frac {(b c-2 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a} c^2}+\frac {x \sqrt {a+\frac {b}{x}}}{c} \]

[Out]

(-2*a*d+b*c)*arctanh((a+b/x)^(1/2)/a^(1/2))/c^2/a^(1/2)+2*arctan(d^(1/2)*(a+b/x)^(1/2)/(-a*d+b*c)^(1/2))*d^(1/
2)*(-a*d+b*c)^(1/2)/c^2+x*(a+b/x)^(1/2)/c

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {375, 99, 156, 63, 208, 205} \[ \frac {2 \sqrt {d} \sqrt {b c-a d} \tan ^{-1}\left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )}{c^2}+\frac {(b c-2 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a} c^2}+\frac {x \sqrt {a+\frac {b}{x}}}{c} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b/x]/(c + d/x),x]

[Out]

(Sqrt[a + b/x]*x)/c + (2*Sqrt[d]*Sqrt[b*c - a*d]*ArcTan[(Sqrt[d]*Sqrt[a + b/x])/Sqrt[b*c - a*d]])/c^2 + ((b*c
- 2*a*d)*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/(Sqrt[a]*c^2)

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 99

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[((a + b
*x)^(m + 1)*(c + d*x)^n*(e + f*x)^(p + 1))/((m + 1)*(b*e - a*f)), x] - Dist[1/((m + 1)*(b*e - a*f)), Int[(a +
b*x)^(m + 1)*(c + d*x)^(n - 1)*(e + f*x)^p*Simp[d*e*n + c*f*(m + p + 2) + d*f*(m + n + p + 2)*x, x], x], x] /;
 FreeQ[{a, b, c, d, e, f, p}, x] && LtQ[m, -1] && GtQ[n, 0] && (IntegersQ[2*m, 2*n, 2*p] || IntegersQ[m, n + p
] || IntegersQ[p, m + n])

Rule 156

Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :>
 Dist[(b*g - a*h)/(b*c - a*d), Int[(e + f*x)^p/(a + b*x), x], x] - Dist[(d*g - c*h)/(b*c - a*d), Int[(e + f*x)
^p/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 375

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> -Subst[Int[((a + b/x^n)^p*(c +
 d/x^n)^q)/x^2, x], x, 1/x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\sqrt {a+\frac {b}{x}}}{c+\frac {d}{x}} \, dx &=-\operatorname {Subst}\left (\int \frac {\sqrt {a+b x}}{x^2 (c+d x)} \, dx,x,\frac {1}{x}\right )\\ &=\frac {\sqrt {a+\frac {b}{x}} x}{c}-\frac {\operatorname {Subst}\left (\int \frac {\frac {1}{2} (b c-2 a d)-\frac {b d x}{2}}{x \sqrt {a+b x} (c+d x)} \, dx,x,\frac {1}{x}\right )}{c}\\ &=\frac {\sqrt {a+\frac {b}{x}} x}{c}-\frac {(b c-2 a d) \operatorname {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )}{2 c^2}+\frac {(d (b c-a d)) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a+b x} (c+d x)} \, dx,x,\frac {1}{x}\right )}{c^2}\\ &=\frac {\sqrt {a+\frac {b}{x}} x}{c}-\frac {(b c-2 a d) \operatorname {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+\frac {b}{x}}\right )}{b c^2}+\frac {(2 d (b c-a d)) \operatorname {Subst}\left (\int \frac {1}{c-\frac {a d}{b}+\frac {d x^2}{b}} \, dx,x,\sqrt {a+\frac {b}{x}}\right )}{b c^2}\\ &=\frac {\sqrt {a+\frac {b}{x}} x}{c}+\frac {2 \sqrt {d} \sqrt {b c-a d} \tan ^{-1}\left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )}{c^2}+\frac {(b c-2 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a} c^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.24, size = 100, normalized size = 0.96 \[ \frac {2 \sqrt {d} \sqrt {b c-a d} \tan ^{-1}\left (\frac {\sqrt {d} \sqrt {a+\frac {b}{x}}}{\sqrt {b c-a d}}\right )+\frac {(b c-2 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}}+c x \sqrt {a+\frac {b}{x}}}{c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b/x]/(c + d/x),x]

[Out]

(c*Sqrt[a + b/x]*x + 2*Sqrt[d]*Sqrt[b*c - a*d]*ArcTan[(Sqrt[d]*Sqrt[a + b/x])/Sqrt[b*c - a*d]] + ((b*c - 2*a*d
)*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/Sqrt[a])/c^2

________________________________________________________________________________________

fricas [A]  time = 0.97, size = 482, normalized size = 4.63 \[ \left [\frac {2 \, a c x \sqrt {\frac {a x + b}{x}} - {\left (b c - 2 \, a d\right )} \sqrt {a} \log \left (2 \, a x - 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right ) + 2 \, \sqrt {-b c d + a d^{2}} a \log \left (\frac {b d - {\left (b c - 2 \, a d\right )} x + 2 \, \sqrt {-b c d + a d^{2}} x \sqrt {\frac {a x + b}{x}}}{c x + d}\right )}{2 \, a c^{2}}, \frac {2 \, a c x \sqrt {\frac {a x + b}{x}} - 4 \, \sqrt {b c d - a d^{2}} a \arctan \left (\frac {\sqrt {b c d - a d^{2}} x \sqrt {\frac {a x + b}{x}}}{a d x + b d}\right ) - {\left (b c - 2 \, a d\right )} \sqrt {a} \log \left (2 \, a x - 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right )}{2 \, a c^{2}}, \frac {a c x \sqrt {\frac {a x + b}{x}} - {\left (b c - 2 \, a d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a x + b}{x}}}{a}\right ) + \sqrt {-b c d + a d^{2}} a \log \left (\frac {b d - {\left (b c - 2 \, a d\right )} x + 2 \, \sqrt {-b c d + a d^{2}} x \sqrt {\frac {a x + b}{x}}}{c x + d}\right )}{a c^{2}}, \frac {a c x \sqrt {\frac {a x + b}{x}} - 2 \, \sqrt {b c d - a d^{2}} a \arctan \left (\frac {\sqrt {b c d - a d^{2}} x \sqrt {\frac {a x + b}{x}}}{a d x + b d}\right ) - {\left (b c - 2 \, a d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a x + b}{x}}}{a}\right )}{a c^{2}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="fricas")

[Out]

[1/2*(2*a*c*x*sqrt((a*x + b)/x) - (b*c - 2*a*d)*sqrt(a)*log(2*a*x - 2*sqrt(a)*x*sqrt((a*x + b)/x) + b) + 2*sqr
t(-b*c*d + a*d^2)*a*log((b*d - (b*c - 2*a*d)*x + 2*sqrt(-b*c*d + a*d^2)*x*sqrt((a*x + b)/x))/(c*x + d)))/(a*c^
2), 1/2*(2*a*c*x*sqrt((a*x + b)/x) - 4*sqrt(b*c*d - a*d^2)*a*arctan(sqrt(b*c*d - a*d^2)*x*sqrt((a*x + b)/x)/(a
*d*x + b*d)) - (b*c - 2*a*d)*sqrt(a)*log(2*a*x - 2*sqrt(a)*x*sqrt((a*x + b)/x) + b))/(a*c^2), (a*c*x*sqrt((a*x
 + b)/x) - (b*c - 2*a*d)*sqrt(-a)*arctan(sqrt(-a)*sqrt((a*x + b)/x)/a) + sqrt(-b*c*d + a*d^2)*a*log((b*d - (b*
c - 2*a*d)*x + 2*sqrt(-b*c*d + a*d^2)*x*sqrt((a*x + b)/x))/(c*x + d)))/(a*c^2), (a*c*x*sqrt((a*x + b)/x) - 2*s
qrt(b*c*d - a*d^2)*a*arctan(sqrt(b*c*d - a*d^2)*x*sqrt((a*x + b)/x)/(a*d*x + b*d)) - (b*c - 2*a*d)*sqrt(-a)*ar
ctan(sqrt(-a)*sqrt((a*x + b)/x)/a))/(a*c^2)]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Check [ab
s(x)]Error: Bad Argument Type

________________________________________________________________________________________

maple [B]  time = 0.11, size = 287, normalized size = 2.76 \[ -\frac {\sqrt {\frac {a x +b}{x}}\, \left (2 a^{\frac {3}{2}} d^{2} \ln \left (\frac {-2 a d x +b c x -b d +2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {\left (a x +b \right ) x}\, c}{c x +d}\right )-2 \sqrt {a}\, b c d \ln \left (\frac {-2 a d x +b c x -b d +2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {\left (a x +b \right ) x}\, c}{c x +d}\right )+2 \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, a c d \ln \left (\frac {2 a x +b +2 \sqrt {\left (a x +b \right ) x}\, \sqrt {a}}{2 \sqrt {a}}\right )-\sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, b \,c^{2} \ln \left (\frac {2 a x +b +2 \sqrt {\left (a x +b \right ) x}\, \sqrt {a}}{2 \sqrt {a}}\right )-2 \sqrt {\left (a x +b \right ) x}\, \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {a}\, c^{2}\right ) x}{2 \sqrt {\left (a x +b \right ) x}\, \sqrt {\frac {\left (a d -b c \right ) d}{c^{2}}}\, \sqrt {a}\, c^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b/x)^(1/2)/(c+d/x),x)

[Out]

-1/2*((a*x+b)/x)^(1/2)*x*(2*ln(1/2*(2*a*x+b+2*((a*x+b)*x)^(1/2)*a^(1/2))/a^(1/2))*(d*(a*d-b*c)/c^2)^(1/2)*a*c*
d-ln(1/2*(2*a*x+b+2*((a*x+b)*x)^(1/2)*a^(1/2))/a^(1/2))*(d*(a*d-b*c)/c^2)^(1/2)*b*c^2+2*ln((2*(d*(a*d-b*c)/c^2
)^(1/2)*((a*x+b)*x)^(1/2)*c-2*a*d*x+b*c*x-b*d)/(c*x+d))*a^(3/2)*d^2-2*ln((2*(d*(a*d-b*c)/c^2)^(1/2)*((a*x+b)*x
)^(1/2)*c-2*a*d*x+b*c*x-b*d)/(c*x+d))*a^(1/2)*b*c*d-2*((a*x+b)*x)^(1/2)*c^2*a^(1/2)*(d*(a*d-b*c)/c^2)^(1/2))/(
(a*x+b)*x)^(1/2)/c^3/a^(1/2)/(d*(a*d-b*c)/c^2)^(1/2)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sqrt {a + \frac {b}{x}}}{c + \frac {d}{x}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2)/(c+d/x),x, algorithm="maxima")

[Out]

integrate(sqrt(a + b/x)/(c + d/x), x)

________________________________________________________________________________________

mupad [B]  time = 1.63, size = 149, normalized size = 1.43 \[ \frac {x\,\sqrt {a+\frac {b}{x}}}{c}+\frac {\ln \left (\sqrt {a+\frac {b}{x}}-\sqrt {a}\right )\,\left (a\,d-\frac {b\,c}{2}\right )}{\sqrt {a}\,c^2}-\frac {\ln \left (\sqrt {a+\frac {b}{x}}+\sqrt {a}\right )\,\left (2\,a\,d-b\,c\right )}{2\,\sqrt {a}\,c^2}-\frac {\mathrm {atan}\left (\frac {b^4\,d^3\,\sqrt {a+\frac {b}{x}}\,\sqrt {a\,d^2-b\,c\,d}\,4{}\mathrm {i}}{4\,a\,b^4\,d^4-4\,b^5\,c\,d^3}\right )\,\sqrt {a\,d^2-b\,c\,d}\,2{}\mathrm {i}}{c^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/x)^(1/2)/(c + d/x),x)

[Out]

(x*(a + b/x)^(1/2))/c - (atan((b^4*d^3*(a + b/x)^(1/2)*(a*d^2 - b*c*d)^(1/2)*4i)/(4*a*b^4*d^4 - 4*b^5*c*d^3))*
(a*d^2 - b*c*d)^(1/2)*2i)/c^2 + (log((a + b/x)^(1/2) - a^(1/2))*(a*d - (b*c)/2))/(a^(1/2)*c^2) - (log((a + b/x
)^(1/2) + a^(1/2))*(2*a*d - b*c))/(2*a^(1/2)*c^2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sqrt {a + \frac {b}{x}}}{c x + d}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)**(1/2)/(c+d/x),x)

[Out]

Integral(x*sqrt(a + b/x)/(c*x + d), x)

________________________________________________________________________________________